<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickshadereffectmesh.cpp -->
  <title>GridMesh QML 类型 | Qt Quick 5.12.3</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.12</a></td><td ><a href="qtquick-index.html">Qt Quick</a></td><td ><a href="qtquick-qmlmodule.html">QML类型</a></td><td >GridMesh QML 类型</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtquick-index.html">Qt 5.12.3 参考指南</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">目录</a></h3>
<ul>
<li class="level1"><a href="#properties">属性</a></li>
<li class="level1"><a href="#details">详细信息</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">GridMesh QML 类型</h1>
<span class="subtitle"></span>
<!-- $$$GridMesh-brief -->
<p>定义顶点排列在网格中的网格。 <a href="#details">更多...</a></p>
<!-- @@@GridMesh -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> 导入语句：</td><td class="memItemRight bottomAlign"> import QtQuick 2.12</td></tr><tr><td class="memItemLeft rightAlign topAlign"> 
	<span lang="zh-cn">引入于：</span></td><td class="memItemRight bottomAlign">  Qt 5.0</td></tr></table></div><ul>
<li><a href="qml-qtquick-gridmesh-members.html">所有成员的列表，包括继承成员</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">属性</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-gridmesh.html#resolution-prop">resolution</a></b></b> : size</li>
</ul>
<!-- $$$GridMesh-description -->
<a name="details"></a>
<h2 id="details">详细信息</h2>
<p><a href="file:///E:/WLL/work/Qt5.12-Document-Trans-in-Chinese/qtquick/qml-qtquick-gridmesh.html">GridMesh</a>定义了一个矩形网格，由排列在均匀间隔网格中的顶点组成。它用于生成<a href="file:///E:/WLL/work/Qt5.12-Document-Trans-in-Chinese/qtquick/qsggeometry.html">几何体</a>。网格分辨率由<a href="file:///E:/WLL/work/Qt5.12-Document-Trans-in-Chinese/qtquick/qml-qtquick-gridmesh.html#resolution-prop">分辨率</a>属性指定。</p>
<!-- @@@GridMesh -->
<h2>属性文档</h2>
<!-- $$$resolution -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="resolution-prop">
<td class="tblQmlPropNode"><p>
<a name="resolution-prop"></a><span class="name">resolution</span> : <span class="type"><a href="../qtqml/qml-size.html">size</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>此属性保存网格分辨率。分辨率的宽度和高度分别指定水平和垂直顶点之间的单元格数或间距。最小值和默认值是 1x1，总共对应四个顶点，每个角一个。对于非线性顶点变换，您可能希望将分辨率设置得更高。</p>
<div class="table"><table class="generic">
 <tr valign="top" class="odd"><td ><p class="centerAlign"><img src="images/declarative-gridmesh.png" alt="" /></p></td><td ><pre class="qml">

  import QtQuick 2.0

  <span class="type"><a href="qml-qtquick-shadereffect.html">ShaderEffect</a></span> {
      <span class="name">width</span>: <span class="number">200</span>
      <span class="name">height</span>: <span class="number">200</span>
      <span class="name">mesh</span>: <span class="name">GridMesh</span> {
          <span class="name">resolution</span>: <span class="name">Qt</span>.<span class="name">size</span>(<span class="number">20</span>, <span class="number">20</span>)
      }
      property <span class="type"><a href="../qtqml/qml-variant.html">variant</a></span> <span class="name">source</span>: <span class="name">Image</span> {
          <span class="name">source</span>: <span class="string">&quot;qt-logo.png&quot;</span>
          <span class="type">sourceSize</span> { <span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>: <span class="number">200</span> }
      }
      <span class="name">vertexShader</span>: <span class="string">&quot;
          uniform highp mat4 qt_Matrix;
          attribute highp vec4 qt_Vertex;
          attribute highp vec2 qt_MultiTexCoord0;
          varying highp vec2 qt_TexCoord0;
          uniform highp float width;
          void main() {
              highp vec4 pos = qt_Vertex;
              highp float d = .5 * smoothstep(0., 1., qt_MultiTexCoord0.y);
              pos.x = width * mix(d, 1.0 - d, qt_MultiTexCoord0.x);
              gl_Position = qt_Matrix * pos;
              qt_TexCoord0 = qt_MultiTexCoord0;
          }&quot;</span>
  }

</pre>
</td></tr>
</table></div>
</div></div><!-- @@@resolution -->
<br/>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
